#ifndef CANDRIVE_H
#define CANDRIVE_H
#include "ControlCAN.h"
#include <cstdint>
#include <QQueue>

class CanDrive
{
public:
    CanDrive();
    DWORD OpenCAN();
    DWORD InitCAN(int baundrate);
    DWORD ClearBuffer();
    DWORD GetBoardInfo();
    DWORD StartCAN();
    DWORD CloseCAN();
    int32_t canTransmitData(uint32_t id ,uint8_t len ,uint8_t *buf);
    int32_t canReceiveData(void) ;
    VCI_CAN_OBJ canRecvObj[1024] ;
    QQueue<VCI_CAN_OBJ> frame_queue;

private:
    DWORD device_type = 4;     // 设备/CAN卡类型
    DWORD device_index = 0;    // 设备索引
    DWORD reserved = 0;        // 保留参数
    int can_chanel = 0;
    VCI_BOARD_INFO* vbi;
};
#endif // CANDRIVE_H
